Conventionally, in the FA (Factory Automation) field and the like, there have been put into practical application, various kinds of image processing devices that perform the processing of a presence test of a defect and stain on the work as a measurement object, measurement of a size and a shape of the work, and recognition of a character and a shape on the work. As an example of the image processing in the FA field, there has been known the processing of estimating a shape element of a mark and the like that have been printed to the work in advance, and performing positioning based on the estimate result.
In this image processing, mixing of noise into the image due to various kinds of disturbance cannot be avoided. As methods for enhancing measurement precision by removing such noise, there have been known techniques disclosed in Unexamined Japanese Patent Publication No. 2007-249555 and Unexamined Japanese Patent Publication No. 2009-186338.
Unexamined Japanese Patent Publication No. 2007-249555 discloses a technique of realizing a high-accurate approximation straight line by efficiently excluding an outlier from coordinates included in the coordinate group. Unexamined Japanese Patent Publication No. 2009-186338 discloses a technique capable of correctly detecting a defect such as flash and chip based on a difference of each edge point from a proper base line that has been set to each of a plurality of edge points, even when an object has a complex shape. That is, these prior art documents disclose a method for determining a straight line element that shows an outer shape of a measurement object from the edge position.